package spring.mvc;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Function:
 *
 * @author crossoverJie
 *         Date: 15/04/2018 21:58
 * @since JDK 1.8
 */
@Controller
public class ExceptionController {

    private static final Logger logger = LoggerFactory.getLogger(ExceptionController.class);

    /**
     * 返回一个 int，模拟 MVC 的类型转换异常，Spring MVC 不输出异常堆栈，why？因为日志输出的是字符串
     *  logger.debug("Failed to complete request: " + failureCause);
     */
    @RequestMapping("/getInt")
    // @ResponseBody
    public Integer setStockNum() {
        return 10;
    }

}
